package eip.chapter10.processmanager.handler;

import org.mule.extras.client.MuleClient;
import org.mule.umo.UMOMessage;

public class MuleConnector {
	
	public static Object invokeRequestResponse(String target, String message) throws Exception {
		MuleClient muleClient = new MuleClient();
		UMOMessage responseMessage = muleClient.send(target, message, null);
		return responseMessage.getPayload();
	}
	
	public static void invokeFireAndForget(String target, String message) throws Exception {
		MuleClient muleClient = new MuleClient();
		muleClient.sendNoReceive(target, message, null);
	}

}
